package cn.yunyichina.scheduler.jobs.job.bone;

import cn.yunyichina.scheduler.jobs.service.bone.BoneSeekHelpCancleService;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.type.simple.api.SimpleJob;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * Created by zhuxp on 2017/12/28.
 *  求助订单取消 超过24小时
 * @param
 * @Descrition
 */
@Component
public class BoneSeekHelpOrderCancleJob implements SimpleJob {

    private static final AtomicInteger count = new AtomicInteger(0);

    private Logger logger = LoggerFactory.getLogger(BoneUserVisitPushJob.class);

    @Autowired
    private BoneSeekHelpCancleService boneSeekHelpCancleService;
    @Override
    public void execute(ShardingContext shardingContext) {
        int current = count.addAndGet(1);
        logger.info("第[{}]次患者求助订单取消任务开始执行", current);
        boneSeekHelpCancleService.doExecute();
        logger.info("第[{}]次患者求助订单取消任务执行结束", current);
    }
}
